package com.platform.core.repository;

import com.platform.comm.repository.CustomBaseRepository;
import com.querydsl.core.types.dsl.StringExpression;
import com.querydsl.core.types.dsl.StringPath;
import com.platform.core.entity.NcloudSysNotifyEntity;
import com.platform.core.entity.QNcloudSysNotifyEntity;
import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer;
import org.springframework.data.querydsl.binding.QuerydslBindings;
import org.springframework.data.querydsl.binding.SingleValueBinding;

import javax.annotation.Nullable;

/**
 * Description: -JPA接口
 *
 * @author Coder
 */
public interface NcloudSysNotifyRepository extends CustomBaseRepository<NcloudSysNotifyEntity, String>, QuerydslBinderCustomizer<QNcloudSysNotifyEntity> {

    /**
     * 自定义查询条件
     *
     * @param bindings 定义查询路径
     * @param root     q查询对象
     */
    @Override
    default void customize(QuerydslBindings bindings, @Nullable QNcloudSysNotifyEntity root) {
        bindings.bind(String.class).first(
                (SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase
        );
    }
}
